<template>
  <div class="main">
    <van-nav-bar
      :title="title"
      :right-text="right_text"
      left-arrow
      @click-left="onClickLeft"
      @click-right="onClickRight"
    />
	
    <!-- 登录和注册页面需要,其他地方不需要 -->
	
	<!-- 
	<div>
      <img src="~@/assets/gostockgo_logo.png" alt="logo" />
    </div> 
	-->
    <router-view />
  </div>
</template>

<script>
export default {
  name: "index",
  data() {
    return {
      title: this.$route.meta.title
    };
  },
  methods: {
    onClickLeft() {
      this.$router.back();
    },
    onClickRight() {
      if (this.title === "注册") this.$router.push("/account/login");
    }
  },
  computed: {
    right_text() {
      this.title = this.$route.meta.title;
      if (this.title === "注册") {
        return "去登陆";
      }
      return "";
    }
  }
};
</script>

<style scope>
/* img {
  width: 100px;
  height: 100px;
  display: block;
  margin: 10px auto;
}
.main {
  background: url("~@/assets/back.jpg") repeat no-repeat;
  background-size: 100%;
  height: 100vh;
} */
</style>
